package com.example.demo.repository;

import com.example.demo.entity.Student;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;

import java.util.List;

/**
 * Created by pengwan on 2017/7/26.
 */
// @CrossOrigin(origins = "http://localhost:4200") // 解决前后端分离的跨域问题
@RepositoryRestResource(collectionResourceRel = "student", path = "student") // 在'/student'处创建RESTful入口点
public interface StudentRepository extends JpaRepository<Student, String> {
    List<Student> findByName(@Param(value = "name") String name);
}
